from models.base_enum import BaseEnum


class AccountStatus(BaseEnum):
    """
    账号状态
    """
    NORMAL = "normal"  # 正常
    DISABLED = "disabled"  # 停用
    LOCKED = "locked"  # 锁定
    DELETED = "deleted"  # 删除

    @classmethod
    def to_list(cls):
        return [(cls.NORMAL, '正常'), (cls.DISABLED, '停用'), (cls.LOCKED, '锁定'), (cls.DELETED, '删除')]


class AccountRole(BaseEnum):
    """
    账号角色
    """
    ADMIN = "account_role_admin"  # 超级管理员
    OPERATION_STAFF = "account_role_operation_staff"  # 运营人员

    @classmethod
    def to_list(cls):
        return [(cls.ADMIN, '超级管理员'), (cls.OPERATION_STAFF, '运营人员')]


class SystemLogModule(BaseEnum):
    """
    日志操作模块
    """
    LOGIN = "system_log_module_login"  # 登录
    CREATE_SYSTEM_USER = "system_log_module_create_system_user"  # 新增CMS管理员
    UPDATE_SYSTEM_USER = "system_log_module_update_system_user"  # 修改CMS管理员
    DISABLED_SYSTEM_USER = "system_log_module_disabled_system_user"  # 禁用CMS管理员
    ENABLED_SYSTEM_USER = "system_log_module_enabled_system_user"  # 启用CMS管理员
    CREATE_IMAGE_LIBRARY = "system_log_module_create_image_library"  # 新增图片素材
    UPDATE_IMAGE_LIBRARY = "system_log_module_update_image_library"  # 修改图片素材
    CREATE_VIDEO_LIBRARY = "system_log_module_create_video_library"  # 新增视频素材
    UPDATE_VIDEO_LIBRARY = "system_log_module_update_video_library"  # 修改视频素材
    CREATE_ALBUM_INFO = "system_log_module_create_album_info"  # 新增短剧信息
    UPDATE_ALBUM_INFO = "system_log_module_update_album_info"  # 修改短剧信息
    CREATE_ALBUM_EPISODE_INFO = "system_log_module_create_album_episode_info"  # 新增短剧剧集信息
    UPDATE_ALBUM_EPISODE_INFO = "system_log_module_update_album_episode_info"  # 修改短剧剧集信息

    @classmethod
    def to_list(cls):
        return [(cls.LOGIN, '登录'), (cls.CREATE_SYSTEM_USER, '新增CMS管理员'),
                (cls.UPDATE_SYSTEM_USER, '修改CMS管理员'), (cls.DISABLED_SYSTEM_USER, '禁用CMS管理员'),
                (cls.ENABLED_SYSTEM_USER, '启用CMS管理员'), (cls.CREATE_IMAGE_LIBRARY, '新增图片素材'),
                (cls.UPDATE_IMAGE_LIBRARY, '修改图片素材'), (cls.CREATE_VIDEO_LIBRARY, '新增视频素材'),
                (cls.UPDATE_VIDEO_LIBRARY, '修改视频素材'), (cls.CREATE_ALBUM_INFO, '新增短剧信息'),
                (cls.UPDATE_ALBUM_INFO, '修改短剧信息'), (cls.CREATE_ALBUM_EPISODE_INFO, '新增短剧剧集信息'),
                (cls.UPDATE_ALBUM_EPISODE_INFO, '修改短剧剧集信息')]


class ImageLibraryStatus(BaseEnum):
    """
    图片素材库状态
    """
    NORMAL = "image_library_status_normal"  # 正常
    DELETED = "image_library_status_deleted"  # 删除

    @classmethod
    def to_list(cls):
        return [(cls.NORMAL, "正常"), (cls.DELETED, "删除")]


class FileType(BaseEnum):
    """
    文件类型
    """
    IMAGE = "file_type_image"  # 图片
    VIDEO = "file_type_video"  # 视频

    @classmethod
    def to_list(cls):
        return [(cls.IMAGE, "图片"), (cls.VIDEO, "视频")]


class VideoLibraryStatus(BaseEnum):
    """
    视频素材库状态
    """
    NORMAL = "video_library_status_normal"  # 正常
    DELETED = "video_library_status_deleted"  # 删除

    @classmethod
    def to_list(cls):
        return [(cls.NORMAL, "正常"), (cls.DELETED, "删除")]


class VideoLibraryOssStatus(BaseEnum):
    """
    视频上传状态
    """
    WAIT = "video_library_oss_status_wait"  # 待上传
    SUCCESS = "video_library_oss_status_success"  # 上传成功
    FAIL = "video_library_oss_status_fail"  # 上传失败

    @classmethod
    def to_list(cls):
        return [(cls.WAIT, "待上传"), (cls.SUCCESS, "上传成功"), (cls.FAIL, "上传失败")]


class VideoLibraryDySyncStatus(BaseEnum):
    """
    视频同步抖音内容库状态
    """
    WAIT_COMMIT = "video_library_dy_sync_status_wait_commit"  # 待提交
    WAIT_SYNC = "video_library_dy_sync_status_wait_sync"  # 待同步
    SUCCESS = "video_library_dy_sync_status_success"  # 同步成功
    FAIL = "video_library_dy_sync_status_fail"  # 同步失败

    @classmethod
    def to_list(cls):
        return [(cls.WAIT_COMMIT, "待提交"), (cls.WAIT_SYNC, "待同步"), (cls.SUCCESS, "同步成功"),
                (cls.FAIL, "同步失败")]


class AlbumStatus(BaseEnum):
    """
    抖音短剧更新状态
    """
    NOT_RELEASED_YET = "album_status_not_released_yet"  # 未上映
    ONGOING = "album_status_ongoing"  # 更新中
    COMPLETED = "album_status_completed"  # 已完结

    @classmethod
    def to_list(cls):
        return [(cls.NOT_RELEASED_YET, "未上映", 1), (cls.ONGOING, "更新中", 2), (cls.COMPLETED, "已完结", 3)]

    @classmethod
    def get_dy_code(cls, key):
        return cls.get_extra_field(key, 2)


class Qualification(BaseEnum):
    """
    抖音短剧资质状态
    """
    NOT_SUBMITTED = "qualification_not_submitted"  # 未报审
    APPROVED = "qualification_approved"  # 报审通过
    REJECTED = "qualification_rejected"  # 报审不通过
    NOT_RECOMMENDED = "qualification_not_recommended"  # 不建议报审

    @classmethod
    def to_list(cls):
        return [(cls.NOT_SUBMITTED, "未报审", 1), (cls.APPROVED, "报审通过", 2), (cls.REJECTED, "报审不通过", 3),
                (cls.NOT_RECOMMENDED, "不建议报审", 4)]

    @classmethod
    def get_dy_code(cls, key):
        return cls.get_extra_field(key, 2)


class RecordType(BaseEnum):
    """
    备案号类型
    """
    NORMAL = "record_type_normal"  # 普通备案号
    KEY = "record_type_key"  # 重点备案号

    @classmethod
    def to_list(cls):
        return [(cls.NORMAL, "普通备案号", 10), (cls.KEY, "重点备案号", 20)]

    @classmethod
    def get_dy_code(cls, key):
        return cls.get_extra_field(key, 2)


class PlayletProductionCost(BaseEnum):
    """
    制作成本类型
    """
    BELOW_300K = "playlet_production_cost_below_300k"  # 30万以下
    BETWEEN_300K_1M = "playlet_production_cost_between_300k_1m"  # 30～100万
    ABOVE_1M = "playlet_production_cost_above_1m"  # 100万以上

    @classmethod
    def to_list(cls):
        return [(cls.BELOW_300K, "30万以下", 10), (cls.BETWEEN_300K_1M, "30～100万", 20), (cls.ABOVE_1M, "30～100万", 30)]

    @classmethod
    def get_dy_code(cls, key):
        return cls.get_extra_field(key, 2)
